package com.welsy.classroom.business
{
	import mx.controls.Alert;
	import com.welsy.usermgt.vo.UserVO;
	import com.adobe.cairngorm.business.ServiceLocator;
	import mx.rpc.soap.mxml.WebService;
	import mx.rpc.AbstractOperation;
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	import mx.logging.Log;
	import com.welsy.usermgt.vo.ClassVO;
	import flash.xml.XMLNode;
	import mx.collections.ArrayCollection;
	import mx.rpc.soap.Operation;
	import com.welsy.util.NamespaceLocator;
	import com.welsy.iter.vo.IterVO;

	
	public class AddUserDelegate 
	{
		private var responder : IResponder;
		private var service : Object;
		
		public function AddUserDelegate( responder : IResponder ) {
			//Recorded in Services.mxml
			this.responder = responder;
			this.service = ServiceLocator.getInstance().getWebService("ClassroomServices") as WebService;
		}
				
		public function addUser(classId : String, userId : String, login : String) : void {
			
			var op : AbstractOperation = service.getOperation("AddUser");
			op.arguments.AddUserRequest.ClassroomId = classId;
			op.arguments.AddUserRequest.UserId = userId;
			op.arguments.AddUserRequest.Login = login;
			
			var token : AsyncToken = service.AddUser();
			token.addResponder(responder);
						
		}
	}	
}